namespace egret.socketio {

    export interface Handle {
        destory(): void;
    }

    export function on(obj: Emitter, ev: string, fn: Function, listenerContext?: any): Handle {
        obj.on(ev, fn, listenerContext);
        return {
            destory: (): void => {
                obj.off(ev, fn, listenerContext);
            }
        };
    }
}